<?php

require '../model/jiekousetmodel.php';

class jiekousetcontrol{
	private $model;//业务模型
	private $view;

	public function __construct(){
		
		$this->view="../view/main.php?url=jiekouset.php";
		$this->model=new jiekousetmodel();
	}


	public function load($view=null){
		if(empty($view))
		{				
			header("location:{$this->view}");
		}
		else{
			header("location:{$view}");
		}

	}
	
	/*
	 *
	*
	*/
	public function doAction($action){
		if($action=='xiu'){			
			$this->action_jiekousetquery();
		}
		else if($action=='tian'){			
			$this->action_jiekousettian();
		}
		else{
			$this->load();
		}

	}

	//骑手修改
	public function action_jiekousetquery(){
		
		$jiekousetid=$_GET['jiekousetid'];
		$zhang=$_POST['zhang'];
	    if (!empty($zhang)){		
	    $jiekouset=new  jiekousetmodel();
	    $jiekouset->jiekousetquery($jiekousetid,$zhang);
		}
		$this->load($this->view);
	}
	//骑手添加
	public function action_jiekousettian(){
		$ming=$_POST['ming'];
		$zhang=$_POST['zhang'];
	    $jiekouset=new  jiekousetmodel();
	    $jiekouset->jiekousettian($ming,$zhang);//,$img
		//}
		//回自己界面
		$this->load($this->view);
	}
	
}
?>